.include "asm/include/battle_commands.inc"

.data

_000:
    TryReplaceFaintedMon BATTLER_CATEGORY_ATTACKER, TRUE, _029
    Call BATTLE_SUBSCRIPT_ATTACK_MESSAGE_AND_ANIMATION
    TryRestoreStatusOnSwitch BATTLER_CATEGORY_ATTACKER, _013
    UpdateMonData OPCODE_SET, BATTLER_CATEGORY_ATTACKER, BMON_DATA_STATUS, STATUS_NONE

_013:
    DeletePokemon BATTLER_CATEGORY_ATTACKER
    Wait 
    HealthbarSlideOut BATTLER_CATEGORY_ATTACKER
    Wait 
    UpdateVarFromVar OPCODE_SET, BSCRIPT_VAR_BATTLER_SWITCH, BSCRIPT_VAR_BATTLER_ATTACKER
    UpdateVar OPCODE_FLAG_ON, BSCRIPT_VAR_BATTLE_STATUS, BATTLE_STATUS_BATON_PASS
    GoToSubscript BATTLE_SUBSCRIPT_SHOW_PARTY_LIST

_029:
    UpdateVar OPCODE_FLAG_ON, BSCRIPT_VAR_MOVE_STATUS_FLAGS, MOVE_STATUS_FAILED
    End 
